package com.tencreat.mapper.mall;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tencreat.common.core.HttpResult;
import com.tencreat.domain.mall.BalanceChange;
import com.tencreat.domain.mall.GoodsRollOrder;
import com.tencreat.domain.mall.vo.AccumulatedVO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
 * 余额变动Mapper接口
 *
 * @author wangkai
 * @date 2021-11-15
 */
public interface BalanceChangeMapper extends BaseMapper<BalanceChange> {

    BigDecimal sumByReferrer(@Param("uuid") Long uuid);

    AccumulatedVO accumulatedRecharge(Long uuid);

    AccumulatedVO accumulatedConsumer(Long uuid);

    IPage<GoodsRollOrder> goodsRollList(Page<GoodsRollOrder> page, @Param("params")GoodsRollOrder goodsRollOrder);

    BigDecimal rechargeAmount();

    BigDecimal useTotalConsumeRoll();
}
